﻿CREATE TABLE [steve].[UserContent] (
    [MembershipId] UNIQUEIDENTIFIER NOT NULL,
    [ContentId]    UNIQUEIDENTIFIER NOT NULL,
    [ReadDate]     DATETIME2(7)         NOT NULL,
    [Rating]       DECIMAL (8, 7)   NULL,
    [RatingDate]   DATETIME2(7)         NULL
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'This table is used to track when users read content.   
NOTE: There are potential problems with tracking this, each page that could possibly be “read” must have code to record this, also it will only work if a user is logged in, which in a lot of scenarios of reading content is not the case.  We may be able to work a solution using unique visitor key or storing a previous membership ID in a cookie or something.', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'UserContent';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Link to Content table', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'UserContent', @level2type = N'COLUMN', @level2name = N'ContentId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Rating of the content between 0 and 1 (.6 = 3 out of 5 stars)', @level0type = N'SCHEMA', @level0name = N'steve', @level1type = N'TABLE', @level1name = N'UserContent', @level2type = N'COLUMN', @level2name = N'Rating';

